package com.pig.pojo.commgoods;
import java.io.Serializable;

/**
 * 控制层将数据封装好发送到前台的对象
 */
public class JsonResult implements Serializable {
    private static final long serialVersionUID = -2274083774288948061L;
    private Integer status = 200;
    private String message = "OK";
    private Object data;

    public JsonResult() {
    }

    public JsonResult(Object data) {
        this.data = data;
    }

    public JsonResult(Throwable t) {
        this.status = -1;
        this.message = t.getMessage();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "JsonResult{" +
                "status=" + status +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
